Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

minimisted

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minimisted

Handy wrapper of `minimist`

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

minimisted v2.0.1

CI codecov js-standard-style

A handy wrapper of minimist

Install

npm install minimisted

Usage

You can write your cli like the following:

// Your cli's entry point
const main = (argv) => {
}

require('minimisted')(main)

where argv is the command line options parsed by minimist i.e. minimist(process.argv.slice(2)).

Using object destructuring syntax, you can write it like the following:

/**
 * @param {boolean} help Shows help message if true
 * @param {boolean} version Shows the version if true
 * ...
 * @param {string[]} _ The parameters
 */
const main = ({ help, version, _ }) => {
}

require('minimisted')(main)

API

const minimisted = require('minimisted')

minimisted(main[, opts[, argv]])

  • @param {Function} main The main function
  • @param {Object} opts The option which is passed to minimist's 2rd arguments
  • @param {string} argv The command line arguments. Default is process.argv.slice(2).

This calls main with command line options parsed by the minimist with the given options.

License

MIT

Keywords

FAQs

Package last updated on 22 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc